package sjtu.ist.warehouse4ws.tool;


import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

public class MyFilter extends org.springframework.web.filter.DelegatingFilterProxy {

	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain filterChain) throws ServletException, IOException {
		String path = ((HttpServletRequest) request).getRequestURI();
		//System.out.println("Paht:"+path);
		if (path.startsWith("/WareHouse4WS/uploaddialog/js/uploadFiles")|| path.startsWith("/WareHouse4WS/uploaddialog/js/uploadOtherFiles")||path.startsWith("/WareHouse4WS/uploaddialog/js/uploadPackage")) { 
			System.out.println("---------跳过shiro框架，exclude /uploadFiles");
			filterChain.doFilter(request, response); // Just continue chain.
		} else {
			super.doFilter(request, response, filterChain);
		}		
	}
}
